package com.qiyu.tech.mysql.service;

import com.qiyu.tech.mysql.dao.db1.DB1Dao;
import com.qiyu.tech.mysql.dao.db2.DB2Dao;
import com.qiyu.tech.mysql.model.OrderPO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author linhao
 * @Date created in 2:58 下午 2021/1/28
 */
@RestController
public class TestController {

    @Resource
    private DB1Dao db1Dao;

    @Resource
    private DB2Dao db2Dao;

    @GetMapping(value = "/do-test-db")
    public List<OrderPO> doTestDB(int i){
        if(i==1){
            return db1Dao.selectAll();
        } else {
            return db2Dao.selectAll();
        }
    }
}
